home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / lib / Dictionary.h < prev    next >
C/C++ Source or Header  |  1990-05-19  |  2KB  |  68 lines

  1. #ifndef    DICTIONARY_H
  2. #define    DICTIONARY_H
  3.  
  4. /*$Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/lib/RCS/Dictionary.h,v 3.0 90/05/20 00:19:27 kgorlen Rel $*/
  5.  
  6. /* Dictionary.h -- declarations for Set of Associations
  7.  
  8.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  9.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  10.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  11.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  12.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  13.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  14.  
  15. Author:
  16.     K. E. Gorlen
  17.     Computer Systems Laboratory, DCRT
  18.     National Institutes of Health
  19.     Bethesda, MD 20892
  20.  
  21. $Log:    Dictionary.h,v $
  22.  * Revision 3.0  90/05/20  00:19:27  kgorlen
  23.  * Release for 1st edition.
  24.  * 
  25. */
  26.  
  27. #include "Set.h"
  28.  
  29. class Assoc;
  30. class LookupKey;
  31. class OrderedCltn;
  32.  
  33. class Dictionary: public Set {
  34.     DECLARE_MEMBERS(Dictionary);
  35. #ifndef BUG_38
  36. // internal <<AT&T C++ Translator 2.00 06/30/89>> error: bus error (or something nasty like that)
  37. protected:        // storer() functions for object I/O
  38.     virtual    void storer(OIOofd& fd)    const    { Set::storer(fd); };
  39.     virtual    void storer(OIOout& strm) const    { Set::storer(strm); };
  40. #endif
  41. public:
  42.     Dictionary(unsigned size =DEFAULT_CAPACITY);
  43.     void operator=(const Dictionary&);
  44.     bool operator==(const Dictionary&) const;
  45.     bool operator!=(const Dictionary& d) const { return !(*this == d); }
  46.     virtual    Object* add(Object&);
  47.     virtual Assoc* addAssoc(Object& key, Object& value);
  48.     virtual Collection& addContentsTo(Collection&) const;
  49.     virtual Collection& addKeysTo(Collection&) const;
  50.     virtual Collection& addValuesTo(Collection&) const;
  51.     virtual LookupKey* assocAt(const Object& key) const;
  52.     virtual Object* atKey(const Object& key) const;
  53.     virtual Object* atKey(const Object& key, Object& newValue);
  54.     virtual bool includesAssoc(const LookupKey& asc) const;
  55.     virtual bool includesKey(const Object& key) const;
  56.     virtual bool isEqual(const Object&) const;
  57.     virtual Object* keyAtValue(const Object& val) const;
  58.     virtual unsigned occurrencesOf(const Object& val) const;
  59.     virtual Object* remove(const Object& asc);
  60.     virtual LookupKey* removeAssoc(const LookupKey& asc);
  61.     virtual LookupKey* removeKey(const Object& key);
  62.     virtual const Class* species() const;
  63. private:                // shouldNotImplement()
  64.     virtual int compare(const Object&) const;
  65. };
  66.  
  67. #endif
  68.